home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 4 / Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso / Development / General / ViewIt™ 2.24 Shareware / FaceWare / FaceWare.rsrc / TEXT_1320_BC10. Color Pickers.txt < prev    next >
Text File  |  1994-04-10  |  3KB  |  18 lines

  1. Color Pickers
  2.   "Color Picker" controls are a special case of pop-up resource lists (described above in "Pop-Up Palettes" topic).  The primary purpose of such controls is to provide the user with a simple way to pick an RGB color, although they can also be used to display static colors that are not user-selectable.
  3.   Color Picker controls must be linked to clut 1310, and have their "content" color defined (via ViewIt's Style menu).  (This contrasts with other clut-based pop-ups that can be linked to any clut and do not make use of the control's content color.)  If they are also type "List or Menu" (versus "Static"), then the control's content color will be user-selectable via a pop-up palette and the Color Picker dialog.
  4.  
  5. Operation
  6.   Color Picker controls always display the control's current content color within the content area of the control.  If the control is clicked (and is type "List or Menu"), then the Color Picker dialog is opened so that the user can select a new control content color.  If the control is clicked and the mouse button is held down, then a palette is popped up from which the user can choose a new content color.  If Color QuickDraw is not supported, then the Picker dialog is never displayed.
  7.   The palette displayed will be either the System color table corresponding to the deepest screen intersecting the control rect, or, if 512 is added to VarCode, the program-wide color palette (which can be reset with the utility command SetPal).  When displaying a System color table, screen depths greater than 4 will result in displaying the 16-color table unless 256 is added to the VarCode, in which case the 256-color table is used.
  8.   If you prefer to have only the Color Picker dialog displayed (i.e., no pop-up palette), then add 1024 to the control's VarCode.
  9.   VarCode options 4 and 8, as described in "Pop-Up Palettes", are also supported by Color Pickers.
  10.   WINDOW NOTE:  Make certain that the "Prefer Color Window" option is checked in the Window dialog so that ViewIt will create a color window when running on machines that support Color QuickDraw.  If you do not do this, then only the original 8 QuickDraw colors can be drawn in the window.
  11.  
  12. Data Linking
  13.   Unlike simple clut-based pop-ups that base data linking on the standard control Value, color picker controls base linking on the control's content color.  Thus color picker controls should be linked to 6-byte RGB-type program variables (data type = 9) for use with GetVal or SetVal.  You can also get the current content color of any control (after calling GetCtl) by passing the control's color table handle to GetFgC:
  14.  FaceIt(nil,GetFgC,0,-2,ord(cColors),2);
  15. where "2" is the part number corresponding to the control's content, and the color is returned in uRGB.
  16.  
  17. Limitations
  18.   No support for hand scrolling.